<div id='detail_progress_indicator'>
  {% load static %}
  <img src="{% get_static_prefix %}img/loading.gif" style="display: none;" id="imgProgress" />
</div>
{% if manifest %}
	<h3 class="manifest_name" id="{{ manifest_name }}">
	  {{ manifest_name }}
  	<div class='pull-right' id='save_and_cancel'>
  	  {% if perms.reports.change_machine %}
  		<input type='button' class='edit btn' value='Edit'></input>
  		{% endif %}
  	</div>
	</h3>
	<p /><p />
	<div id="manifest_detail">
		{% if user %}
		  <div class='manifest_section'>
		  <div class="name_label">User</div>
			<ul id='_user_name' class='user_section unstyled'>
				<li id='{{ manifest_user }}' class='nameitem'>
				{%  if manifest_user_is_editable %}
				  <div class='editable'>{{ manifest_user }}</div>
				{% else %}
				  {{ manifest_user }}
				{% endif %}
				</li>
			</ul>
			</div>
		{% endif %}
		
		<div class='manifest_section'>
		<div class="section_label">Catalogs</div>
		<ul id='catalogs' class='catalogs_section unstyled'>
			{% for item in manifest.catalogs %}
			    <li id='{{ item }}' 
			    {% if item not in valid_catalogs %}
			      class='error lineitem'>{{ item }}
			    {% else %}
			      class='lineitem'>
			      <a href='/catalog/{{ item }}/'>{{ item }}</a>
			    {% endif %}
			    </li>
			{% endfor %}
		</ul>
		</div>
		
		{% if manifest.conditional_items %}
		<div class='manifest_section'>
		<div class="section_label">Conditional Items</div>
		  <span class="muted">viewing/editing conditional_items not currently supported</span>
		  <p/>
		</div>
		{% endif %}
		
		<div class='manifest_section'>
		<div class="section_label">Included Manifests</div>
		<ul id='included_manifests' class='included_manifests_section unstyled'>
			{% for i_manifest in manifest.included_manifests %}
			  <li id='{{ i_manifest }}' 
			  {% if i_manifest not in valid_manifest_names %}
			    class='error lineitem'>{{ i_manifest }}
			  {% else %}
			    class='lineitem'>
				  <a href='#{{ i_manifest }}' onClick="getManifestDetail('{{ i_manifest }}')">{{ i_manifest }}</a>
				{% endif %}</li>
			{% endfor %}
		</ul>
		</div>
		
		<div class='manifest_section'>
		<div class="section_label">Managed Installs</div>
		<ul id='managed_installs' class='section unstyled'>
			{% for item in manifest.managed_installs %}
			    <li id='{{ item }}' {% if manifest.catalogs and item not in valid_install_items %}class='error lineitem'{% else %}class='lineitem'{% endif %}>
				<div class='editable'>{{ item }}</div>
				</li>
			{% endfor %}
		</ul>
		</div>
		
		<div class='manifest_section'>
		<div class="section_label">Managed Uninstalls</div>
		<ul id='managed_uninstalls' class='section unstyled'>
			{% for item in manifest.managed_uninstalls %}
			    <li id='{{ item }}' {% if manifest.catalogs and item not in valid_install_items %}class='error lineitem'{% else %}class='lineitem'{% endif %}>
				<div class='editable'>{{ item }}</div>
				</li>
			{% endfor %}
		</ul>
		</div>
		
		<div class='manifest_section'>
		<div class="section_label">Managed Updates</div>
		<ul id='managed_updates' class='section unstyled'>
			{% for item in manifest.managed_updates %}
			    <li id='{{ item }}' {% if manifest.catalogs and item not in valid_install_items %}class='error lineitem'{% else %}class='lineitem'{% endif %}>
				<div class='editable'>{{ item }}</div>
				</li>
			{% endfor %}
		</ul>
		</div>
		
		<div class='manifest_section'>
		<div class="section_label">Optional Installs</div>
		<ul id='optional_installs' class='section unstyled'>
			{% for item in manifest.optional_installs %}
			    <li id='{{ item }}' {% if manifest.catalogs and item not in valid_install_items %}class='error lineitem'{% else %}class='lineitem'{% endif %}>
				<div class='editable'>{{ item }}</div>
				</li>
			{% endfor %}
		</ul>
		</div>
	</div>
	<div id="csrf_token" style='display:none'>{% csrf_token %}</div>
{% else %}
    <div id="item_name">Manifest is empty</div>
{% endif %}
